package com.xxx.test;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

/**
 * @author hdz
 * @date 2019/03/27
 */
public class MainActivity extends AppCompatActivity {

    private AppManager mAppManager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Logger.d("===TaskId: "+this.getTaskId());
        mAppManager = new AppManager();
        AppInfo appInfo = mAppManager.getAppInfo(this, "com.android.settings");
        if (appInfo != null) {
            Logger.d("PackageName: " + appInfo.getPackageName());
            Logger.d("Name: " + appInfo.getName());
            Logger.d("Version: " + appInfo.getVersion());
        }
    }

    public void onClickGetTopApp(View view) {
        startActivity(new Intent(this, TopAppActivity.class));
    }

    public void test(View view) {
        if (mAppManager != null) {
            mAppManager.goAppDetailSetting(this, "com.android.settings");
        }
    }



}
